#define BUFLEN 16

#define PS_wait 0
#define PS_waitPortInf 1
#define PS_waitLength 2
#define PS_receiving 3
#define PS_ready 4

extern char ReceiverIndex;
extern char PortIndex;
extern unsigned char PortState;
extern char RxData[BUFLEN];
extern unsigned char RxLen;

void SerialReset();
void SerialInit(int b,char RIndex,void (*Callback)(char PortIndex,char *data,unsigned char data_len));
void sendchar(char c);
void sendstr(char* str);
void sendstr(char* str,unsigned char len);
void SerialUpdate();
void SendData(char* str,unsigned char len, char Receiver,char Port);
void NullCallback(char PortIndex,char *data,unsigned char data_len);
